<extend name="Base/common"/>

<block name="header">
    <link type="text/css" rel="stylesheet" href="__CSS__/news.css"/>
     <include file="Public/_nav"/>
</block>

<block name="body">
    <div class="container">
        <div class="row">
            <div class="col-xs-8">
                <div class="common_block_border">
                    <notempty name="now_category">
                        <div class="common_block_title">{$now_category.title}
                            <div class="pull-right children_blog">
                                <volist name="now_category['_']" id="cat">
                                    <a href="{:U('News/index/index',array('category'=>$cat['id']))}">{$cat.title}</a>
                                </volist>
                            </div>
                        </div>
                        <else/>
                        <div class="common_block_title">新视野</div>
                    </notempty>
                    <div class="common_block_title clearfix">
                        <if condition="$info['cover'] neq 0">
                            <div class="col-xs-4">
                                <a title="{$info.title|op_t}" href="{:U('News/index/detail',array('id'=>$info['id']))}">
                                    <img alt="{$info.title|op_t}" src="{$info.cover|getThumbImageById=200,146}" style="width: 200px;height: 146px">
                                </a>
                            </div>
                            <div class="col-xs-8">
                                <h2>{$info.title}</h2>
                                <p class="clearfix">
                                    <if condition="check_auth('News/Index/edit',$info['uid'])&&($info['status'] neq 1)">
                                        <a title="编辑" href="{:U('News/index/edit',array('id'=>$info['id']))}" style="float: right"><i class="icon-edit" style="font-size: 16px;">编辑</i></a>
                                    </if>
				                    <span class="pull-left">
                                        <span class="author"><a href="{$author.space_url}" ucard="{$author.uid}">{$author.nickname}</a></span>
					                    <span> 发表于 {$info.create_time|date='Y-m-d H:i',###}</span>
                                                 </span>
                                    <if condition="($info['status'] eq 1)&&($info['dead_line'] gt time())">
                                        <span class="pull-right" style="margin-right: 10px">{:W('Weibo/Share/shareBtn',array('param'=>array('title'=>$info['title'],'content'=>$info['description'],'img'=>getThumbImageById($info['cover'],160,160),'from'=>$MODULE_ALIAS,'site_link'=>U('news/index/detail',array('id'=>$info['id']))),'text'=>'分享'))}</span>
                                    </if>
                                </p>
                                <div style="color: #999;font-size: 14px;">{$info.description}</div>
                            </div>
                            <else/>
                            <h2>{$info.title}</h2>
                            <p class="clearfix">
                                <if condition="check_auth('News/Index/edit',$info['uid'])&&($info['status'] neq 1)">
                                    <a title="编辑" href="{:U('News/index/edit',array('id'=>$info['id']))}" style="float: right"><i class="icon-edit" style="font-size: 16px;">编辑</i></a>
                                </if>
                                <span class="pull-left">
                                    <span class="author">
                                        <a href="{$author.space_url}" ucard="{$info.uid}">{$author.nickname}</a>
                                    </span>
                                    <span> 发表于 {$info.create_time|date='Y-m-d H:i',###}</span>
                                </span>
                                <if condition="($info['status'] eq 1)&&($info['dead_line'] gt time())">
                                    <span class="pull-right" style="margin-right: 10px">{:W('Weibo/Share/shareBtn',array('param'=>array('title'=>$info['title'],'content'=>$info['description'],'img'=>getThumbImageById($info['cover'],160,160),'from'=>$MODULE_ALIAS,'site_link'=>U('news/index/detail',array('id'=>$info['id']))),'text'=>'分享'))}</span>
                                </if>
                            </p>
                            <div style="color: #999;font-size: 14px;">{$info.description}</div>
                        </if>
                    </div>
                    <hr/>
                    <section id="contents">
                        <if condition="$info['source'] neq ''"><div style="margin-bottom: 20px;color: #C0C0C0;"><i class="icon-chrome"></i> 来源：{$info.source}</div></if>
                        <div class="news-content">{$info.detail.content|render}</div>
                    </section>
                    <div style="padding: 20px">
                        {:hook('localComment', array('path'=>"News/index/$info[id]", 'uid'=>$info['uid'],'count_model'=>'news','count_field'=>'comment','this_url'=>'news/index/detail'))}
                    </div>
                </div>
            </div>
            <div class="col-xs-4">
                <div class="common_block_border">
                    <div class="common_block_title">作者</div>
                    <div class="col-xs-4">
                        <img class="avatar-img" src="{$author.avatar64}"/>
                    </div>
                    <div class="col-xs-8">
                        <a href="{$author.space_url}">{$author.nickname}</a>
                        <br/>
                        <p class="text-more" style="width: 100%">{$author.signature}</p>
                        <br/>
                        文章：{$author.news_count}
                    </div>
                    <div class="clearfix" style="padding: 10px"></div>
                </div>
                {:W('Position/lists',array('position'=>4,'category'=>$info['category']))}
                {:W('Hot/lists',array('category'=>$info['category']))}
            </div>

        </div>


    </div>
    <script type="text/javascript" charset="utf-8" src="__STATIC__/ueditor/third-party/SyntaxHighlighter/shCore.js"></script>
    <link rel="stylesheet" type="text/css" href="__STATIC__/ueditor/third-party/SyntaxHighlighter/shCoreDefault.css"/>
    <script type="text/javascript">
        SyntaxHighlighter.all();
    </script>
    <script>
        $(document).ready(function () {
            $('.popup-gallery').each(function () { // the containers for all your galleries
                $(this).magnificPopup({
                    delegate: '.popup',
                    type: 'image',
                    tLoading: 'Loading image #%curr%...',
                    mainClass: 'mfp-img-mobile',
                    gallery: {
                        enabled: true,
                        navigateByImgClick: true,
                        preload: [0, 1] // Will preload 0 - before current, and 1 after the current image
                    },
                    image: {
                        tError: '<a href="%url%">The image #%curr%</a> could not be loaded.',
                        titleSrc: function (item) {
                            /*           return item.el.attr('title') + '<small>by Marsel Van Oosten</small>';*/
                            return '';
                        }
                    }
                });
            });
        });
    </script>
</block>